package svg

import (
	"strconv"
)

func comma(strs ...string) string {
	ret := ""
	for i, val := range strs {
		if i != 0 {
			ret += ","
		}
		ret += val
	}

	return ret
}

func coords(x, y float64) string {
	return comma(fVal(x), fVal(y))
}

func boolean(b bool) string {
	if b {
		return "1"
	}
	return "0"
}

func fVal(v float64) string {
	return strconv.Ftoa64(v, 'f', -1)
}